package main

import (
	"fmt"
	"strings"
)

func main1() {
	// 类似 stringbuilder？
	builder := strings.Builder{}
	builder.WriteString("sd")
	builder.WriteString("faf")
	fmt.Println(builder.String())
}

func main() {
	s1 := "hello"
	fmt.Println(strings.Contains(s1, "o"))
	fmt.Println()

	arr := []string{"a", "b", "c"}
	fmt.Println(strings.Join(arr, ":"))
	fmt.Println()

	fmt.Println(strings.Index(s1, "e") == -1)
	fmt.Println(strings.Index(s1, "e"))
	fmt.Println()

	// 去除头部和尾部的指定字符， 不是头尾无效
	s2 := "        i o u   "
	fmt.Println(strings.Trim(s2, " "))
	fmt.Println(strings.Trim(s2, "o"))
	fmt.Println()

	s3 := "daa@dasd@ddf@"
	fmt.Println(strings.Split(s3, "@"))
	fmt.Println(strings.Split(s2, " "))
	fmt.Println()

	fmt.Println(strings.Fields(s2))
	fmt.Println()

	fmt.Println(strings.Repeat("a", 10))

}
